from django.db import models
from rest_framework import serializers


class WebInfo(models.Model):
    id = models.AutoField(primary_key=True)
    slogan = models.CharField(max_length=200, verbose_name='标语')
    announcement = models.TextField(verbose_name='公告')
    description = models.TextField(verbose_name='网站介绍')
    qq_contact = models.CharField(max_length=20, verbose_name='QQ联系方式')
    email_contact = models.CharField(max_length=100, verbose_name='邮箱联系方式')
    github_url = models.CharField(max_length=500, verbose_name='GitHub地址')
    gitee_url = models.CharField(max_length=500, verbose_name='Gitee地址')
    bilibili_url = models.CharField(max_length=500, verbose_name='Bilibili地址')

    class Meta:
        db_table = "web_info"


class WebInfoSerializer(serializers.ModelSerializer):
    class Meta:
        model = WebInfo
        fields = '__all__'
